from django.conf.urls import url, include
from rest_framework import routers
from .views import  UserCreateCaptchaViewSet, CreateUserViewSet, UserLoginView
from django.views.decorators.cache import cache_page
from .my_cache import cache_view

router = routers.DefaultRouter()
router.register('captcha',  UserCreateCaptchaViewSet)
router.register('register', CreateUserViewSet)

urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^login/', UserLoginView.as_view()),
    url(r'^test/', cache_page(10)(cache_view)),
]